package cn.buk.tms.entity.misc;

import jakarta.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: yfdai
 * Date: 14-4-17
 * Time: 下午10:45
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name="t501",uniqueConstraints=@UniqueConstraint(name="uk_t501",	columnNames={"productCode"}))
public class Product {

    /**
     *<行程单打印>产品代码
     */
    public static final String ITINERARY_PRINT_CODE = "P001";

    public static final String MONITOR_CTRIP_DOM_POLICY   = "P010"; //携程国内比价
    public static final String MONITOR_CTRIP_INTL_POLICY  = "P011"; //携程国际比价
    public static final String UPLOAD_FD_CTRIP_DOM_POLICY_OW = "P012"; //根据FD的价格, 生成并上传携程国内单程政策
    public static final String UPLOAD_FD_CTRIP_DOM_POLICY_RT = "P013"; //根据FD的价格, 生成并上传携程国内往返政策
    public static final String UPLOAD_FD_QUNAR_DOM_POLICY_OW = "P014"; //根据FD的价格, 生成并上传去哪国内单程政策

    public static final String ETERM_FREE_AV = "P020"; //每日免费的AV次数
    public static final String ETERM_AUTO_SS = "P021"; //eterm追位

    public static final String FORM_ASSISTANT_MU_B2T = "P101"; //MU B2T的辅助填单（临时团数据自动填写）表单助手

    public static final int CHARGE_UNIT_BY_DAY = 0; //按日计价
    public static final int CHARGE_UNIT_BY_QUANTITY_PER_DAY = 1; //按每日的数量计价
    public static final int CHARGE_UNIT_BY_MONTH = 2; //按月计价，30天 , 月付都从现金账户里扣款
    public static final int CHARGE_UNIT_BY_PERSON_COUNT = 8; //按人数

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private int id;

    /**
     * 产品代码
     */
    @Column(length=5)
    private String productCode;

    /**
     * 产品名称
     */
    @Column(length=20)
    private String productName;

    /**
     * 计价单位
     * CHARGE_UNIT_BY_DAY: 比特币/日
     * CHARGE_UNIT_BY_QUANTITY_PER_DAY: 比特币/条/日
     * CHARGE_UNIT_BY_PERSON_COUNT：比特币/人
     */
    private int chargeUnit;

    /**
     * 零售价(比特币)
     */
    @Column(name = "unitPrice")
    private int retailPrice;

    /**
     * 批发价
     */
    @Column(name = "wholesale_price")
    private Integer wholesalePrice;

    /**
     * 最小批发数量
     */
    @Column(name = "min_wholesale_count")
    private Integer minWholesaleCount;

    /**
     * 产品描述，备注
     */
    @Column(length=200)
    private String remark;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getChargeUnit() {
        return chargeUnit;
    }

    public void setChargeUnit(int chargeUnit) {
        this.chargeUnit = chargeUnit;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public int getWholesalePrice() {
        return wholesalePrice == null ? this.retailPrice : wholesalePrice;
    }

    public void setWholesalePrice(Integer wholesalePrice) {
        this.wholesalePrice = wholesalePrice;
    }

    public int getMinWholesaleCount() {
        return minWholesaleCount == null ? 1 : minWholesaleCount;
    }

    public void setMinWholesaleCount(Integer minWholesaleCount) {
        this.minWholesaleCount = minWholesaleCount;
    }

    public int getRetailPrice() {
        return retailPrice;
    }

    public void setRetailPrice(int retailPrice) {
        this.retailPrice = retailPrice;
    }
}
